/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: syyyy
 * Date: 2025-07-12
 * Time: 11:38
 */
public class BlankString {
    public int lengthString(String s){
//        //方法一
//        String[] str=s.split(" ");
//        int len=str[str.length-1].length();
//        return len;

        //方法二
        int index=s.lastIndexOf(" ");
        String ss=s.substring(index,s.length()-1);
        int len=ss.length();
        return len;
    }
}
